package com.plian.system.wrapper.sys;

import com.plian.system.dto.sys.SealApplyDTO;
import com.plian.system.entity.sys.SealApply;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.sys.SealApplyVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperConstant;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;


@Mapper(componentModel = WrapperConstant.SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface SealApplyWrapper extends BaseWrapper<SealApply, SealApplyDTO, SealApplyVO> {

    @Override
    @Mappings({
            @Mapping(source = "handledBy", target = "handledByName", qualifiedByName = WrapperConstant.USER_ID_TO_NAME),
            @Mapping(source = "undertakingOfficeId", target = "undertakingOfficeName", qualifiedByName = WrapperConstant.OFFICE_ID_TO_NAME),
            @Mapping(source = "type", target = "typeName", qualifiedByName = WrapperConstant.DICT_CODE_TO_NAME),
            @Mapping(source = "createCompanyId", target = "createCompanyName", qualifiedByName = WrapperConstant.ORG_ID_TO_NAME),
            @Mapping(source = "createUser", target = "createUserName", qualifiedByName = WrapperConstant.USER_ID_TO_NAME),
    })
    SealApplyVO entityToVO(SealApply entity);
}
